home *** CD-ROM | disk | FTP | other *** search
- /*
- * header.h --
- *
- * This defines the types and constants for the network interfaces.
- *
- * Copyright 1990 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- * $Header: /sprite/src/kernel/net/RCS/netInterface.h,v 1.1 90/10/02 12:00:18 jhh Exp $ SPRITE (Berkeley)
- */
-
- #ifndef _NETINTERFACE
- #define _NETINTERFACE
-
- #include <syncTypes.h>
-
- /*
- * Structure that defines a network interface.
- */
-
- typedef struct Net_Interface {
- char *name; /* Name of the interface. */
- int unit; /* Unit number of device. */
- Address ctrlAddr; /* Address of control register. */
- Boolean virtual; /* Is ctrlAddr in kernel VM? */
- int vector; /* Interrupt vector generated by
- * device. */
- ReturnStatus (*init)(); /* Initialization routine. */
- void (*output)(); /* Output a packet. */
- void (*intr)(); /* Handle an interrupt. */
- void (*reset)(); /* Reset the interface */
- ReturnStatus (*ioctl)(); /* Perform ioctls on interface. */
- ReturnStatus (*getStats)(); /* Get performance statistics. */
- int number; /* Interface number. */
- Net_NetworkType netType; /* Type of interface. See below. */
- int flags; /* Status flags. See below. */
- Sync_Semaphore syncOutputMutex;/* Used to wait for packets
- * to be output. */
- Sync_Semaphore mutex; /* Protects network interface board
- * and related data structures. */
- int maxBytes; /* Maximum transfer unit
- * (packet size) */
- int minBytes; /* Minimum transfer unit. */
- void (*packetProc)();/* Packet handler in dev module. */
- ClientData interfaceData; /* Place for the interface routines
- * store store stuff. */
- ClientData devNetData; /* Place for the network device
- * driver to store stuff. */
- Net_Address netAddress[NET_MAX_PROTOCOLS];
- Net_Address broadcastAddress; /* Broadcast address for this
- * interface. */
- } Net_Interface;
-
- /*
- * Flag values for Net_Interface.
- */
-
- #define NET_IFLAGS_RUNNING 0x1 /* The interface is active. */
- #define NET_IFLAGS_BROADCAST 0x2 /* Interface supports broadcast. */
-
- #endif /* _NETINTERFACE */
-
-